<?$this->load->view('header.tpl');?>
	<div id="wrap" class="lw clearfix">

		<div id="main">
			<div id="main-left" style="">
				<?if($news):?>
					<div class="main-left-item clearfix">
						<h1 class="list-title zxdt">最新动态</h1>
						<ul class="list-item">
							<?foreach($news as $n):?>
								<li><a href="/news/show/<?=$n->id?>" class="li-item" target="_blank"><?=$n->title?></a></li>
							<?endforeach?>
						</ul>
						<a href="/news/more" class="more right" target="_blank">更多动态</a>
					</div>
				<?endif?>
				<?if($know):?>
					<div class="main-left-item clearfix">
						<h1 class="list-title zyzs">专业知识</h1>
						<ul class="list-item">
							<?foreach($know as $n):?>
								<li><a href="/know/show/<?=$n->id?>" class="li-item" target="_blank"><?=$n->title?></a></li>
							<?endforeach?>
						</ul>
						<a href="/know/more" class="more right" target="_blank">更多知识</a>
					</div>
				<?endif?>
			</div><!-- //main-left -->
			<div id="main-right">
				<h1 class="pro-title"><?=$p->brand?> - <?=$p->name?></h1>

				<div class="pro1 clearfix">
					<div class="left">
						<a href="/photo/show/<?=$p->id?>" target="_blank"><img src="<?=HTTP_IMAGE . $p->image?>" width="400px" /></a>
						<?$photos = json_decode($p->production_image);
						
							if($photos):
						?>
						<ul class="thumb clearfix">
							<?$i=0;foreach($photos as $img):
								$img = $this->toolimage_model->resize($img,50,50);
							?>
								<li><a href="/photo/show/<?=$p->id?>/<?=$i?>" target="_blank"class="thumba" title="查看大图"><img  src="<?=$img?>"/></a></a></li>
							<?$i++;endforeach;?>
						</ul>
						<?endif?>
						<div class="share">
							<!-- JiaThis Button BEGIN -->
							<span class="t">推荐好友：</span>



<div>
<a title="推荐到新浪微博" id="site-sina" onclick="jdPshowRecommend('http://v.t.sina.com.cn/share/share.php?appkey=2445336821','sina')" href="javascript:void(0)">sina</a>
<a title="推荐到腾讯微博" id="site-qzone" onclick="jdPshowRecommend('http://v.t.qq.com/share/share.php?source=1000002&amp;site=http://www.360buy.com','qzone')" href="javascript:void(0)">qzone</a>
<a title="推荐到人人" id="site-renren" onclick="jdPshowRecommend('http://share.renren.com/share/buttonshare/post/1004?','renren')" href="javascript:void(0)">renren</a>
<a title="推荐到开心网" id="site-kaixing" onclick="jdPshowRecommend('http://www.kaixin001.com/repaste/share.php?','kaixing')" href="javascript:void(0)">kaixing</a>
<a title="推荐到豆瓣" id="site-douban" onclick="jdPshowRecommend('http://www.douban.com/recommend/?','douban')" href="javascript:void(0)">douban</a>									
<a title="通过QQ发送链接给好友" id="site-qq" href="javascript:void(0)" onclick="jdPshowRecommend('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?','qq')">qq</a>
<a title="推荐到MSN" id="site-msn" onclick="jdPshowRecommend('http://profile.live.com/badge/?','MSN')" href="javascript:void(0)">msn</a>
</div>
<script type="text/javascript">
function jdPshowRecommend(url,stype) {
var title = "<?=$p->brand?> - <?=$p->name?>";
var content = "我在@我要好发网 买了一款治疗脱发的非常不错的产品：<?=$p->brand?> - <?=$p->name?>，价格是<?=$p->price?>元一支，效果很好！贴出来共享一下!";
var img ="<?=HTTP_IMAGE . $p->image?>";
var productUrl ="<?=current_url()?>";
var pin = "";
if (stype == "qzone") {
url = url + "&title=" + content + "&pic=" + img + "&url=" + productUrl + pin;
}
if (stype == "sina") {
url = url + "&title=" + content + "&pic=" + img + "&url=" + productUrl + pin;
}
if (stype == "renren") {
url = url + "title=" + title +"&content="+ content + "&pic=" + img + "&url=" + productUrl + pin;
}
if (stype == "kaixing") {
url = url + "rtitle=" + title + "&rcontent=" + content + "&rurl=" + productUrl + pin;
}
if (stype == "douban") {
url = url + "title=" + title + "&comment=" + content + "&url=" + productUrl + pin;
}
if (stype == "qq") {
url = url + "title=" + title + "&desc="+content+"&summary=" + content + "&url=" + productUrl + "&pics=" + img +"&site=我要好发网" + pin;
}
if (stype == "MSN") {
url = url + "url=" + productUrl + pin + "&title=" + title + "&description=" + content + "&screenshot=" + img;
}
window.open(encodeURI(url),"","height=500, width=600");
}
</script> 


	
						</div>
					</div>
					<div class="pre left pro-brif">
					<?=htmlspecialchars_decode(stripslashes($p->brif))?>
					</div>
				</div><!-- pro1 -->

				<div class="pro2">
					<ul class="menu1 clearfix" id="menu1">
						<li class="on" id="li1_1"><a href="javascript:" onclick="change(1,1)">商品介绍</a></li>
						<li class="off" id="li1_2"><a href="javascript:" onclick="change(2,1)">安全检测</a></li>
						<li class="off" id="li1_3"><a href="javascript:" onclick="change(3,1)">其他产品</a></li>
					</ul>
								<!----------------------------------------------------->

					<div id="con1_1">
						<?=htmlspecialchars_decode(stripslashes($p->description))?>
					</div>
					<div id="con1_2" class="hidden">
						<?=htmlspecialchars_decode(stripslashes($p->check_safe))?>
					</div>
					<div id="con1_3" class="hidden">
						<?=htmlspecialchars_decode(stripslashes($p->product))?>
					</div>

			<!----------------------------------------------------->
				</div><!-- //pro2 -->

				<div class="pro3">
					<h2 class="menu2 clearfix">
						<span>网友评论</span>
						<a href="/comment/action/<?=$p->id?>#comment-fom" target="_blank"class="addcomment">发表评论</a>
						<?if(!$this->auth->loged):?><p class="do1">请先 <a href="/sign/in?url=/comment/action/<?=$p->id?>#comment-form">登录</a>，再发表评论</p><?endif?>
					</h2>
						<?if($c):?>
						<?foreach($c as $com):?>
							<div class="comment-list clearfix">
								<div class="c-left left"></div>
								<div class="c-center left">
									<p class="title"><?=$com->content?></p>
									<p class="time"><?=$com->time?></p>
								</div>
								<div class="c-right right">
									<?=$com->uname?>
								</div>
							</div>
						<?endforeach;endif;?>
						<p>共<?=$num?>条评论
							<?if(count($c) <= $num):?>
							<a href="/comment/action/<?=$p->id?>" target="_blank" class="more right">查看更多评论</a>
							<?endif?>
						</p>
						<?if(!$this->auth->loged):?><p class="do">请先 <a href="/sign/in?url=/comment/action/<?=$p->id?>#comment-form" >登录</a>，再发表评论</p><?endif?>


				</div><!-- //pro3 -->

				<div class="pro4">
					<ul class="menu1 clearfix" id="menu2">
						<li class="on" id="li2_1"><a href="javascript:"  onclick="change(1,2)">商品咨询</a></li>
						<li class="off" id="li2_2"><a href="javascript:"  onclick="change(2,2)">支付方式</a></li>
						<li class="off" id="li2_3"><a href="javascript:"  onclick="change(3,2)">配送方式</a></li>
						<li class="off" id="li2_4"><a href="javascript:"  onclick="change(4,2)">售后服务</a></li>
						<li class="off" id="li2_5"><a href="javascript:"  onclick="change(5,2)">常见问题</a></li>
						<li class="add"><a href="/zixun/action/<?=$p->id?>#zixun-form" target="_blank">发表咨询</a></li>
					</ul>
						<div id="con2_1">
							<?if($z1):foreach($z1 as $zz1):?>
								<div class="qa-list clearfix">
									<p class="time">网友：<?=$zz1->uname?> <?=$zz1->time?></p>
									<div class="q-left left"></div>
									<p class="q-right left">咨询内容： <?=$zz1->content?></p>
									<div class="clearfix"></div>
									<?if(isset($zz1->reply)):?>
										<div id="reply-text-<?=$zz1->id?>">
											<div class="a-left left"></div>
											<p class="a-right left">客服回复：<?=$zz1->reply->content?></p>
										</div>
									<?endif?>
								</div>
								<?endforeach;?>
							
								<p>共<?=$num1?>条咨询<a href="/zixun/action/<?=$p->id?>/1" target="_blank"class="more right">更多咨询</a></p>
							<?endif;?>
							
						</div><!--//con1-->

						<div id="con2_2" class="hidden">
							<?if(isset($zf)) echo htmlspecialchars_decode(stripslashes($zf->content));?>
						</div>
						<div id="con2_3" class="hidden">
							<?if(isset($ps)) echo htmlspecialchars_decode(stripslashes($ps->content));?>
						</div>
						<div id="con2_4" class="hidden">
							<?if(isset($ss)) echo htmlspecialchars_decode(stripslashes($ss->content));?>
						</div>
						<div id="con2_5" class="hidden">
							<?if(isset($cj)) echo htmlspecialchars_decode(stripslashes($cj->content));?>
						</div>

				</div><!-- //pro4 -->

				<div class="pro5">
					<h2 class="menu2 clearfix">
						<span>网友论坛</span>
						<?if(!$this->auth->loged):?><a href="/topic/more/<?=$p->id?>#topic-form" class="addtopic" target="_blank">发表话题</a><p class="do1">请先 <a href="/sign/in?url=/topic/more/<?=$p->id?>#topic-form">登录</a>，再发表话题</p><?else:?>
						<a href="#topic-form" class="addtopic">发表话题</a>
						<?endif?>
					</h2>
					<?if($topic):?>
					<table class="discuz">
						<tr>
							<th class="table-left t4">话题</th>
							<th class="t3">回复/浏览</th>
							<th class="t3">作者</th>
							<th class="t3">时间</th>
						</tr>
						<?foreach($topic as $t):?>
						<tr>
							<td class="table-left"><a href="/topic/show/<?=$t->id?>"><?=$t->title?></a></td>
							<td><?=$t->reply_num?>/<?=$t->view_num?></td>
							<td><?=$t->uname?></td>
							<td><?=$t->time?></td>
						</tr>
						<?endforeach?>
					</table>
					<p>共<?=$topic_num?>个话题<?if($topic_num > count($topic)):?><a href="/topic/more/<?=$p->id?>" target="_blank"class="more right">更多话题</a><?endif?></p>
					<?else:?>
						<p>还没有话题</p>
					<?endif?>
					<?if(!$this->auth->loged):?>
						<p class="do">请先 <a href="/sign/in?url=/topic/more/<?=$p->id?>#topic-form">登录</a>，再发表话题</p>
					<?endif?>
					<form action="/zixun/action" method="post" id="topic-form"class="form2" onsubmit="return false;">
						<div class="form-item">
							<div class="top">
								<label for="content">发表话题</label>
							</div>
							<div class="item">
								<div class="form-right-label">
									<label for="tc_title">话题标题</label>
								</div>
								<div class="form-right-text off">
									<input type="text" class="text w1" id="tc_title" value=""name="tc_title" />
									<span class="form-border-right"></span>
								</div>
							</div>
							<div class="item">
								<div class="form-right-label">
									<label for="tc_cont">话题内容</label>
								</div>
								<div class="form-textarea-item tr-off clearfix">
									<textarea name="tc_cont" id="tc_cont" class="textarea"></textarea>
									<span class="form-border-right"></span>
								</div>
								</div>

							<div class="footer clearfix">
								<input type="submit" class="button" value="发表看法" onclick="add_topic(<?=$p->id?>,<?=$this->auth->loged?>)" />
								<input type="reset" class="cancel" value="取消" />
							</div>
						</div>
					</form>
					
				</div>
			</div><!-- //main-right -->
		</div><!-- //main -->

	</div>

<?$this->load->view('footer.tpl');?>